package com.youlemall.manager.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.youlemall.common.pojo.PageResult;
import com.youlemall.pojo.Seller;
import com.youlemall.service.SellerService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 2 * @Author: kevin
 * 3 * @Date: 2019/7/18 18:09
 * 4
 */

@RestController
@RequestMapping("/seller")
public class SellerController {

	@Reference(timeout = 10000)
	private SellerService sellerService;

	@GetMapping("/findByPage")
	public PageResult findByPage(Seller seller, Integer page,
								 @RequestParam(defaultValue = "10") Integer rows){
		return sellerService.findByPage(seller,page,rows);
	}

	@GetMapping("/updateStatus")
	public boolean updateStatus(Seller seller){
		try {
			sellerService.updateStatus(seller);
			return true;
		} catch (Exception e) {
			e.printStackTrace();
		}
		return false;
	}
}
